package com.wsj.message_server.utils;

import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public  class AvaSizeUtil {

    @ApiModelProperty(notes = "头像尺寸小")
    private  static String avatarSmallUrl;


    @ApiModelProperty(notes = "头像尺寸中")
    private String avatarMediumUrl;


    @ApiModelProperty(notes = "头像尺寸大")
    private String avatarLargeUrl;


    @ApiModelProperty(notes = "封面尺寸中")
    private String coverMediumUrl;


    @ApiModelProperty(notes = "封面尺寸大")
    private String coverLargeUrl;

    public static String getCoverSmallUrl() {
        return coverSmallUrl;
    }

    @ApiModelProperty(notes = "封面尺寸小")
    private static String coverSmallUrl;

    @Value("${coverSmallUrl}")
    public  void setCoverSmallUrl(String coverSmallUrl) {
        AvaSizeUtil.coverSmallUrl = coverSmallUrl;
    }

    public String getAvatarMediumUrl() {
        return avatarMediumUrl;
    }

    public void setAvatarMediumUrl(String avatarMediumUrl) {
        this.avatarMediumUrl = avatarMediumUrl;
    }

    public String getAvatarLargeUrl() {
        return avatarLargeUrl;
    }

    public void setAvatarLargeUrl(String avatarLargeUrl) {
        this.avatarLargeUrl = avatarLargeUrl;
    }

    public String getCoverMediumUrl() {
        return coverMediumUrl;
    }

    public void setCoverMediumUrl(String coverMediumUrl) {
        this.coverMediumUrl = coverMediumUrl;
    }

    public String getCoverLargeUrl() {
        return coverLargeUrl;
    }

    public void setCoverLargeUrl(String coverLargeUrl) {
        this.coverLargeUrl = coverLargeUrl;
    }

    public String getAvatarSmallUrl() {
        return avatarSmallUrl;
    }

    @Value("${avatarSmallUrl}")
    public  void setAvatarSmallUrl(String avatarSmallUrl) {
        AvaSizeUtil.avatarSmallUrl = avatarSmallUrl;
    }

    {
        //avatarSmallUrl = "?x-oss-process=image/auto-orient,1/resize,m_fill,w_375,h_375/quality,q_90/format,webp";
        avatarMediumUrl = "?x-oss-process=image/auto-orient,1/resize,m_fill,w_500,h_500/quality,q_90/format,webp";
        avatarLargeUrl = "?x-oss-process=image/auto-orient,1/resize,m_fill,w_750,h_750/quality,q_90/format,webp";
        coverMediumUrl = "?x-oss-process=image/auto-orient,1/resize,m_fill,w_750,h_750/quality,q_90/format,webp";
        coverLargeUrl = "?x-oss-process=image/auto-orient,1/resize,m_fill,w_1080,h_1080/quality,q_90/format,webp";
    }

}
